package cn.tedu.spring.scope;

import cn.tedu.spring.resource.RestMapper;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author 董代恒
 * @version 1.0
 */
public class TestOrder {
    public static void main(String[] args) {
        //1.创建Ioc容器
        ApplicationContext context = new AnnotationConfigApplicationContext("cn.tedu.spring.scope");
        //2.获取bean对象
        Order order1 = context.getBean("order",Order.class);
        Order order2 = context.getBean("order",Order.class);
        System.out.println(order1==order2);
    }
}
